package com.three.iot.channel.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author luiz
 * @Title: AliyunProperties
 * @ProjectName iot-server
 * @Description: TODO
 * @date 2019-05-08 10:04
 */
@ConfigurationProperties(prefix = "three.iot.aliyun")
@Data
@Component
public class AliyunProperties {
    private static final String DEFAULT_REGION_ID = "cn-shanghai";
    private static final String DEFAULT_PRODUCT_ID = "Iot";
    /**
     * 阿里云accessKey
     */
    private String accessKey;
    /**
     * 阿里云accessSecret
     */
    private String accessSecret;
    /**
     * 地域编号
     */
    private String regionId;
    /**
     * 产品编号
     */
    private String productId;
    /**
     * 请求地址
     */
    private String domainId;

    public String getRegionId() {
        return regionId == null ? DEFAULT_REGION_ID : this.regionId;
    }

    public String getProductId() {
        return productId == null ? DEFAULT_PRODUCT_ID : this.productId;
    }
}
